﻿using Microsoft.Practices.Prism.StoreApps.Interfaces;
using Newtonsoft.Json;
using System.Threading.Tasks;

namespace Sumc.Client.ModernUI.Extensions
{
    public static class NavigationExtensions
    {
        public static async Task<bool> NavigateJson(this INavigationService navigationService, string pageToken, object navigationParameter)
        {
            var parameterJson = await JsonConvert.SerializeObjectAsync(navigationParameter);
            return navigationService.Navigate(pageToken, parameterJson);
        }
    }
}
